local skel = fk.CreateSkill {
  name = "lb_zero__mengyao_eling",
  max_branches_use_time = {
    ["round"] = {
      [Player.HistoryRound] = 1,
    }
  }
}

Fk:loadTranslationTable {
  ["lb_zero__mengyao_eling"] = "恶灵",
  --[":lb_zero__mengyao_eling"] = "每回合限一次，当你受到伤害后，你可以摸一张牌并加1点体力上限。",
  [":lb_zero__mengyao_eling"] = "每轮限一次，当你受到伤害后，你可以加1点体力上限（至多为6）。",

  ["#lb_zero__mengyao_eling"] = "恶灵：你可以增加1点体力上限",

  ["$lb_zero__mengyao_eling1"] = "",
  ["$lb_zero__mengyao_eling2"] = "",
}

skel:addEffect(fk.Damaged, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player.maxHp < 6
    and player:usedSkillTimes(skel.name, Player.HistoryRound, "round") == 0
  end,
  on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player,
      { skill_name = skel.name, prompt = "#lb_zero__mengyao_eling", })
  end,
  on_use = function(self, event, target, player, data)
    player:addSkillBranchUseHistory(skel.name, "round")
    data.extra_data = data.extra_data or {}
    data.extra_data.lb_zero__huiyin = true
    --player:drawCards(1, skel.name)
    --if player.dead then return end
    player.room:changeMaxHp(player, 1)
  end,
})

return skel
